
<%@ page import="ar.org.sstuyv.Expediente"%>
<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'expediente.label', default: 'Expediente')}" />
<title><g:message code="default.list.label" args="[entityName]" /></title>
<jq:resources />
<jqui:resources />
<jqgrid:resources />

<script type="text/javascript">
			// Here we set a globally the altRows option
			jQuery.extend(jQuery.jgrid.defaults, { 
				altRows: true,
				altclass: 'teams-alt-class'  
				});
		</script>

<script type="text/javascript">
			$(function(){ 
			  $("#teamsAdvanced").jqGrid({
			    url:'${createLink(action: 'listAdvancedJSON')}',
			    editurl:'${createLink(action: 'update')}',
			    datatype: 'json',
			    mtype: 'GET',
			    colNames:['Id','Numero', 'Alcance','Cuerpo', 'Extracto', 'Fecha Inicio', 'Tipo de Expediente'],
			    colModel :[ 
			      {name:'id', index:'id', width:55, align:'right'}, 
			      {name:'numero', editable:true, index:'codigo', width:90}, 
			      {name:'alcance', editable:true, index:'nombre', width:55}, 
			      {name:'cuerpo', editable:true, editoptions: {maxlength: 10}, editrules:{number:true}, index:'numero', width:100, align:'right'},
			      {name:'extracto', editable:true, index:'nombre', width:400},
			      {name:'fechaInicio', editable:true, index:'nombre', width:50},
			      {name:'tipoExpediente', editable:true, index:'nombre', width:200}
			      
			    ],
			    pager: '#pagerAdvanced',
			    rowNum:20,
			    rowList:[20,30,40,50],
			    sortname: 'id',
			    sortorder: 'desc',
			    height: "100%",
			    viewrecords: true,
			    gridview: true,
			    caption: 'Expedientes',
			  });

			  jQuery("#teamsAdvanced").jqGrid('navGrid', '#pagerAdvanced', 
				  { view: true, edit: true, add: true, del: true, search: false }, 
				  {}, // use default settings for edit
				  {url:'${createLink(action: 'save')}'}, // use default settings for add
				  {url:'${createLink(action: 'delete')}'},  // delete instead that del:false we need this
				  {});

			  jQuery("#teamsAdvanced").filterToolbar({});
			   
			}); 
		</script>
</head>
<body>
	<a href="#list-expediente" class="skip" tabindex="-1"><g:message
			code="default.link.skip.label" default="Skip to content&hellip;" /></a>
	
	<g:render template="/comun/menu" />
	
	<div id="list-expediente" class="content scaffold-list" role="main">
		
		<g:if test="${flash.message}">
			<div class="message" role="status">
				${flash.message}
			</div>
		</g:if>

		<div class="list">
			<table id="teamsAdvanced"></table>
			<div id="pagerAdvanced"></div>
		</div>
</body>
</html>
